﻿using System.Reflection;

namespace A3;

class Program
{
    static void Main(string[] args)
    {
        var personType = typeof(Person);
        
        var constructor = personType.GetConstructor(new[] { typeof(string), typeof(int) });
        
        var personInstance = constructor?.Invoke(new object[] { "Alice", 30 });
        
        if (personInstance is Person person)
        {
            person.Display();
        }
    }
}